package com.icinfo.cloud.provider.punish.api.controller;

import com.icinfo.cloud.common.core.page.PageResponse;
import com.icinfo.cloud.provider.common.constant.Constant;
import com.icinfo.cloud.provider.punish.api.dto.CaseActsCodeBigScreenQueryDto;
import com.icinfo.cloud.provider.punish.api.service.ICaseActsCodeService;
import com.icinfo.cloud.provider.punish.api.vo.*;
import com.icinfo.framework.common.web.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 行为码案件对外接口
 * @Author mahan
 * @Date 2022/11/9
 */
@RestController
@RequestMapping("/punish/api/case/actsCode")
public class CaseActsCodeController {

    @Resource
    private ICaseActsCodeService caseActsCodeService;


    /**
     * 案件详情-行政处罚
     * @param caseActsCode
     * @return
     */
    @GetMapping("/getCaseActsCodeInfo")
    public Result<CaseActsCodeInfoVo> getCaseActsCodeInfo(@RequestParam String caseActsCode) {
        return Result.success(Constant.STRING_GET_SUCCESS, caseActsCodeService.getCaseActsCodeInfo(caseActsCode));
    }

    /**
     * 案件详情-案件基本信息、处罚结果、当事人信息
     * @param caseActsCode
     * @return
     */
    @GetMapping("/getCaseActsCodeDetailInfo")
    public Result<CaseActsCodeDetailInfoVo> getCaseActsCodeDetailInfo(@RequestParam String caseActsCode) {
        return Result.success(Constant.STRING_GET_SUCCESS, caseActsCodeService.getCaseActsCodeDetailInfo(caseActsCode));
    }

    /**
     * 一码知全貌-行政处罚
     * @param caseActsCode
     * @return
     */
    @GetMapping("/getCaseActsCodePunishInfo")
    public Result<CaseActsCodeKnowPunishInfoVo> getCaseActsCodePunishInfo(@RequestParam String caseActsCode) {
        return Result.success(Constant.STRING_GET_SUCCESS, caseActsCodeService.getCaseActsCodePunishInfo(caseActsCode));
    }


    /**
     * 大屏统计-行政检查-行政处罚
     * @return
     */
    @GetMapping("/getBigScreenStatistics")
    public Result<CaseActsCodeBigScreenStatisticsVo> getBigScreenStatistics() {
        return Result.success(Constant.STRING_GET_SUCCESS, caseActsCodeService.getBigScreenStatistics());
    }

    /**
     * 大屏-行政处罚分页列表查询
     * @return
     */
    @PostMapping("/queryCaseActsCodeBigScreenPage")
    public Result<PageResponse<CaseActsCodeBigScreenListVo>> queryCaseActsCodeBigScreenPage(@RequestBody CaseActsCodeBigScreenQueryDto dto) {
        List<CaseActsCodeBigScreenListVo> list =  caseActsCodeService.queryCaseActsCodeBigScreenPage(dto);
        return Result.success(Constant.STRING_GET_SUCCESS, new PageResponse<>(list));
    }

}
